<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>景点管理管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(
			function() {
				//$("#name").focus();
				$("#inputForm")
						.validate(
								{
									submitHandler : function(form) {
										loading('正在提交，请稍等...');
										form.submit();
									},
									errorContainer : "#messageBox",
									errorPlacement : function(error, element) {
										$("#messageBox").text("输入有误，请先更正。");
										if (element.is(":checkbox")
												|| element.is(":radio")
												|| element.parent().is(
														".input-append")) {
											error.appendTo(element.parent()
													.parent());
										} else {
											error.insertAfter(element);
										}
									}
								});
			});
	$(document).ready(function() {
		var tpl = 'treeTableTpl';
		var data = ${fns:toJson(list)}, rootId = "0";
		addRow("#treeTableList", tpl, data, rootId, true);
		$("#treeTable").treeTable({expandLevel : 5});
	});
	function addRow(list, tpl, data, pid, root){
		for (var i=0; i<data.length; i++){
			var row = data[i];
			if ((${fns:jsGetVal('row.parentId')}) == pid){
				$(list).append(template(tpl, {
					dict: {
						type: getDictLabel(${fns:toJson(fns:getDictList('sys_area_type'))}, row.type)
					}, pid: (root?0:pid), row: row
				}));
				addRow(list, tpl, data, row.id);
			}
		}
	}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/viewspot/sysViewspot/">景点管理列表</a></li>
		<li class="active"><a
			href="${ctx}/viewspot/sysViewspot/form?id=${sysViewspot.id}">景点管理<shiro:hasPermission
					name="viewspot:sysViewspot:edit">${not empty sysViewspot.id?'修改':'添加'}</shiro:hasPermission>
				<shiro:lacksPermission name="viewspot:sysViewspot:edit">查看</shiro:lacksPermission></a></li>
	</ul>
	<br />
	<form:form id="inputForm" modelAttribute="sysViewspot"
		action="${ctx}/viewspot/sysViewspot/save" method="post"
		class="form-horizontal">
		<form:hidden path="id" />
		<sys:message content="${message}" />
		<%-- <div class="control-group">
			<label class="control-label">景点编号：</label>
			<div class="controls">
				<form:input path="spotid" htmlEscape="false" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div> --%>
		<div class="control-group">
			<label class="control-label">景点名称：</label>
			<div class="controls">
				<form:input path="spotname" htmlEscape="false" maxlength="100" size="60"
					class="input-xlarge required" />
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">城市：</label>
			<div class="controls">
				<%-- <form:select path="citycode" class="input-xlarge required">
					<form:option value="" label="" />
					<form:options items="${fns:getDictList('T_city')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select> --%>
				<sys:treeselect id="citycode" name="citycode" value="${sysViewspot.citycode}" labelName="cityName" labelValue="${sysViewspot.cityName}"
					title="区域" url="/sys/area/treeData" cssClass="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">景点类型：</label>
			<div class="controls">
				<form:select path="spottype" class="input-xlarge required">
					<form:option value="" label="" />
					<form:options items="${fns:getDictList('spottype')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">检索码：</label>
			<div class="controls">
				<form:input path="querycode" htmlEscape="false" maxlength="64" class="input-xlarge" readonly="readonly"/>
			</div>
		</div>
		<%-- <div class="control-group">
			<label class="control-label">创建者：</label>
			<div class="controls">
				<form:input path="createBy.id" htmlEscape="false" maxlength="64"
					class="input-xlarge " />
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">创建时间：</label>
			<div class="controls">
				<input name="createTime" type="text" readonly="readonly"
					maxlength="20" class="input-medium Wdate "
					value="<fmt:formatDate value="${sysViewspot.createTime}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});" />
			</div>
		</div> --%>
		<div class="form-actions">
			<shiro:hasPermission name="viewspot:sysViewspot:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit"
					value="保 存" />&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回"
				onclick="history.go(-1)" />
		</div>
	</form:form>
</body>
</html>